//
//  UpdatePwdTableViewCell.m
//  Rail
//
//  Created by hychen on 2018/2/25.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "UpdatePwdTableViewCell.h"

@interface UpdatePwdTableViewCell ()

@end
@implementation UpdatePwdTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self.textField addTarget:self action:@selector(textFieldEditingChanged:) forControlEvents:UIControlEventEditingChanged];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)textFieldEditingChanged:(UITextField *)tf
{
    if (self.textField.text.length>20) {
        [self.textField.text substringToIndex:20];
    }
}

- (IBAction)openButtonClick:(UIButton *)sender
{
    sender.selected = !sender.selected;
    self.textField.secureTextEntry = !sender.selected;
}
@end
